<!--
 * @Author: 杨果 1428758616@qq.com
 * @Date: 2024-03-24 18:08:59
 * @LastEditors: 杨果 1428758616@qq.com
 * @LastEditTime: 2024-05-04 02:55:33
 * @FilePath: \xiaoyangsu\src\App.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div id="app">
    <!-- 点击爱心特效 -->
    <div
      id="heart-bg"
      v-on:mousedown.left="createLoves($event)"
      v-on:mouseup="removeSmallHert"
    >
      <MyHeart ref="background"></MyHeart>
    </div>
    <!-- 首页容器 -->
    <HelloWorld />
  </div>
</template>

<script>
import HelloWorld from "./views/HelloWorld/HelloWorld.vue";
import MyHeart from "./components/MyHeart/MyHeart.vue";
export default {
  name: "App",
  components: {
    HelloWorld,
    MyHeart,
  },
  methods: {
    createLoves() {
      this.$refs.background.createLoves(event);
    },
    removeSmallHert() {
      this.$refs.background.removeSmallHert();
    },
  },
};
</script>

<style>
#heart-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}
</style>
./views/HelloWorld/HelloWorld.vue